package com.oolee.cloud.controller;


import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
@Slf4j
public class OrderController {

    public static final String PAYMENT_URL = "http://CONSUL-PROVIDER-PAYMENT/cloud";

    @Resource
    private RestTemplate restTemplate;

    @RequestMapping(value = "/consume/payment/consul")
    public String payment(){
        String result = restTemplate.getForObject(PAYMENT_URL+"/payment/consul",String.class);
        return result;
    }

}
